<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>  
<html>  
    <head>  
    <meta charset="utf-8">  
    <title>导入配置</title>  
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/homepages/js/functions.js"></script>
 	<script type="text/javascript">
 		var pkS = '${pk}';
 		$(function(){
 			loadPage();
 		});
 		
 		function callBack(msg,info){
 			if(msg == 'Success'){
	 			$('#msg').html("保存成功");
	 			if(parseInt(info) > 0){
		 			$('#tableCount').html("<span style='color:green;'>"+info+"张表已创建</span>");
		 			$("input[name='created']").attr("checked",'true');
		 			$('#INFO_FORM').attr('action',"${pageContext.request.contextPath}/edi/updateSchemaInfo");
		 			//设置为不可改写 不可点击
		 			$("input[name='schemaTypeId']").attr("disabled",'disabled');
		 			$("input[name='tablePrefix']").attr("disabled",'disabled');
		 			$("#EDI001").attr("disabled",'disabled');
		 			$("#EDI003").attr("disabled",'disabled');
	 			}else{
		 			$('#tableCount').html("<span style='color:red;'>文件有误，无法读取表信息</span>");
	 			}
 			}else{
	 			if(msg == 'InvalidFile')alert("文件格式不正确！");
	 			else{$('#tableCount').html("<span style='color:red;'>文件有误，无法读取文件信息</span>");}
 			}
 		}
 		
 		function saveSchema(){
 			$('#INFO_FORM').submit();
 		}
 		
	    function loadPage(){
				var id = 'sys_schema_add';
				$('#pages').load('${pageContext.request.contextPath}/sys/inputForms',
					{'formType':id}); 
		}
		
		function addNew(){
			$('#INFO_FORM').attr('action',"${pageContext.request.contextPath}/edi/saveSchemaInfo");
			$("input[name='schemaTypeId']").removeAttr("disabled");
		 	$("input[name='tablePrefix']").removeAttr("disabled");
			$("#EDI001").removeAttr("disabled");
		}
		
		function delSchema(){
			alert("删除数据"+pkS);
		}
 	</script>
    </head>  
    <body>  
    <div id="pages"></div>
	<iframe name='hidden_frame' id="hidden_frame" style='display:none'></iframe> 
	<span id="tableCount"></span>
	<span id="msg"></span>
	</body>  
</html>  